//
//  AppMicro.h
//  Help_Help
//
//  Created by JNCoder on 14-5-22.
//  Copyright (c) 2014年 TangYanQiong. All rights reserved.
//

#ifndef Help_Help_AppMicro_h
#define Help_Help_AppMicro_h

typedef void(^Callback)(id argument);
typedef id(^CallbackReturn)(id argument);

#define kDeviceWidth                            [UIScreen mainScreen].bounds.size.width
#define kDeviceHeight                           [UIScreen mainScreen].bounds.size.height

#define kAppFrame                               [UIScreen mainScreen].applicationFrame
#define kAppFrameX                              [UIScreen mainScreen].applicationFrame.origin.x
#define kAppFrameY                              [UIScreen mainScreen].applicationFrame.origin.y
#define kAppFrameWidth                          [UIScreen mainScreen].applicationFrame.size.width
#define kAppFrameHeight                         [UIScreen mainScreen].applicationFrame.size.height
#define kAppFrameWidthForMid                    kAppFrameWidth * 0.5
#define kAppFrameHeightForMid                   kAppFrameHeight * 0.5
#define kTableViewCellHeight                    44

#define kAppDelegate                            ((AppDelegate *)[[UIApplication sharedApplication] delegate])
#define kAppWindow                              [[UIApplication sharedApplication] keyWindow]
#define kFontName                               @"MicrosoftYaHei"


#define kRGBA(r, g, b, a)                       [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
#define kRGB(r, g, b)                           kRGBA(r, g, b, 1.0)
#define kRGBA16(value, a)                       kRGBA((value & 0xFF0000)>>16, (value & 0xFF00)>>8, (value & 0xFF), a)
#define kRGB16(value)                           kRGBA16(value, 1.0)

#define Is_iPhone5OrLater                       ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define IOS_Version                             [[[UIDevice currentDevice] systemVersion] floatValue]
#define Is_iOS7OrLater                          ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 ? YES : NO)
#define Is_iOS5OrLater                          ([[[UIDevice currentDevice] systemVersion] floatValue] >= 5.0 ? YES : NO)

#define  kBackGroundColor                           kRGB(14, 157, 205)
#define  kNotifiCationShowKeyboard                  @"kNotifiCationShowKeyboard"
#define  kNotifiCationHidKeyboard                   @"kNotifiCationHidKeyboard"
#define  kNotifiCationLoadContactsRequest           @"kNotifiCationLoadContactsRequest"
#define  kNotifiCationLoadContactsReply             @"kNotifiCationLoadContactsReply"

#define NSNumberWithInt(value)                  [NSNumber numberWithInt:value]


#define SuppressPerformSelectorLeakWarning(Stuff) \
do { \
    _Pragma("clang diagnostic push") \
    _Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"") \
    Stuff; \
    _Pragma("clang diagnostic pop") \
} while (0)

#endif
